#include "Model3D.h"
#include "Engine.h"

Model3D::Model3D()
{
	this->alive = true;	
}

Model3D::~Model3D()
{	
}


void Model3D::MoveLeft()
{	
}

void Model3D::MoveRight()
{	
}

void Model3D::MoveUp()
{	
}

void Model3D::MoveDown()
{	
}

void Model3D::Render()
{
	if(this->alive)
	{
		//***Setting the texture uniform.
		glActiveTexture (GL_TEXTURE0);
		glBindTexture (GL_TEXTURE_2D, textureID);		

		// Load the vertex data
		glVertexAttribPointer (ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, 0, this->vertices);
		glEnableVertexAttribArray (ATTRIB_POSITION);

		//***
		glVertexAttribPointer (ATTRIB_TEXCOORD, 2, GL_FLOAT, GL_FALSE, 0, this->texcoord );
		glEnableVertexAttribArray (ATTRIB_TEXCOORD);
				
		glDrawArrays ( GL_TRIANGLES, 0, this->numvertices);
	}
}